home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / DClap / Dvibrant.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  8.9 KB  |  271 lines  |  [TEXT/R*ch]

  1. /* Dvibrant.h
  2.      modified for use w/ DCLAP library, dgg
  3. */
  4.  
  5.  
  6. #include <dgg.h>
  7.  
  8.  
  9.  
  10. /*   vibrant.h
  11. * ===========================================================================
  12. *
  13. *                            PUBLIC DOMAIN NOTICE
  14. *            National Center for Biotechnology Information (NCBI)
  15. *
  16. *  This software/database is a "United States Government Work" under the
  17. *  terms of the United States Copyright Act.  It was written as part of
  18. *  the author's official duties as a United States Government employee and
  19. *  thus cannot be copyrighted.  This software/database is freely available
  20. *  to the public for use. The National Library of Medicine and the U.S.
  21. *  Government do not place any restriction on its use or reproduction.
  22. *  We would, however, appreciate having the NCBI and the author cited in
  23. *  any work or product based on this material
  24. *
  25. *  Although all reasonable efforts have been taken to ensure the accuracy
  26. *  and reliability of the software and data, the NLM and the U.S.
  27. *  Government do not and cannot warrant the performance or results that
  28. *  may be obtained by using this software or data. The NLM and the U.S.
  29. *  Government disclaim all warranties, express or implied, including
  30. *  warranties of performance, merchantability or fitness for any particular
  31. *  purpose.
  32. *
  33. * ===========================================================================
  34. *
  35. * File Name:  vibrant.h
  36. *
  37. * Author:  Jonathan Kans
  38. *
  39. * Version Creation Date:   7/1/91
  40. *
  41. * $Revision: 2.1 $
  42. *
  43. * File Description: 
  44. *       This is the master include file for the Vibrant (TM) portable user
  45. *       interface.  It includes the Vibrant types, procedures, and defines,
  46. *       and is the only header that most applications need to include.  The
  47. *       first included file (vibtypes.h) includes ncbi.h.
  48. *
  49. * Modifications:  
  50. * --------------------------------------------------------------------------
  51. * Date     Name        Description of modification
  52. * -------  ----------  -----------------------------------------------------
  53. *
  54. *
  55. * ==========================================================================
  56. */
  57.  
  58. #ifndef _VIBRANT_
  59. #define _VIBRANT_
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64.  
  65. /***  GENERAL INFORMATION  ***/
  66.  
  67. /*
  68. *  The NCBI portable user interface development library has been
  69. *  written to allow new algorithms created by our scientists to
  70. *  be quickly implemented and deployed to laboratory researchers
  71. *  as user-friendly computer programs.  These programs run on
  72. *  a variety of personal computers and graphics workstations that
  73. *  are found in many molecular biology laboratories.  Because we
  74. *  are a government agency, we will make the interface toolkit
  75. *  available to scientists and mathematicians outside our group who
  76. *  have similar needs, and to any interested commercial groups.
  77. */
  78.  
  79. /*
  80. *  A program creates the windows, menus, and other user-responsive
  81. *  graphical objects that it needs, attaches programmer-written
  82. *  "callback" functions to appropriate objects (such as push buttons
  83. *  or menu command items), and then calls ProcessEvents.  The object
  84. *  itself handles all of its generic behavior automatically, while
  85. *  the callback function is responsible for providing the specific
  86. *  action that the user has requested.  Callback functions may modify
  87. *  the appearance or behavior of other interface objects.  When the
  88. *  program is ready to quit, it should call QuitProgram.  The ultimate
  89. *  goal is to have identical application programs run properly on all
  90. *  of the supported platforms.
  91. */
  92.  
  93. /*
  94. *  A typical application program will need to include vibrant.h,
  95. *  which imports portable numerical and graphic object types,
  96. *  prototypes of the procedures for creating windows and their
  97. *  graphic objects, and  define statements that alleviate the need
  98. *  for Nlm_ prefixes in all procedures, types, and variables.  The
  99. *  Nlm_ prefix is used in order to avoid collisions with symbols
  100. *  defined by the various compilers and windowing systems under which
  101. *  the interface will run.  When we provide documentation for use of
  102. *  the interface, the definitions of procedures and types will not
  103. *  have the Nlm_ prefix, although the .h and .c files will always
  104. *  need them.  Similarly, object handle names end in a capital letter
  105. *  (e.g., ButtoN, WindoW), in order to lessen the chance of collision
  106. *  with operating system or application program symbols.
  107. */
  108.  
  109. /*
  110. *  A SlatE object provides a generic drawing environment on all
  111. *  platforms.  Each slate can contain several PaneL objects.  Each
  112. *  panel object is given instance callback procedures for drawing,
  113. *  responding to the initial mouse click, mouse drags, repeated
  114. *  holding of the mouse button, and release of the mouse button.
  115. *  The programmer can build new classes of objects for complicated
  116. *  displays based on panel objects.
  117. */
  118.  
  119. /*
  120. *  The platform is a four-dimensional specification of compiler,
  121. *  operating system, processor, and windowing system flags for
  122. *  conditional compilation of the NCBI User Interface Toolkit.
  123. *  These (partially) independent dimensions allow us to write
  124. *  one interface package that will run on the Macintosh under
  125. *  THINK C and MPW C, on the IBM PC under Microsoft C and
  126. *  Microsoft Windows, and on BSD and System V Unix machines
  127. *  running the X Window or OSF/Motif windowing systems.
  128. */
  129.  
  130. /*
  131. *  Familiarity with the NCBI core tools, and the platform concept,
  132. *  are assumed.
  133. */
  134.  
  135.  
  136. #ifndef _VIBTYPES_
  137. #include <vibtypes.h>
  138. #endif
  139.  
  140. #ifndef _VIBPROCS_
  141. #include <vibprocs.h>
  142.  
  143. /* this is from <ncbiport.h> -- Nlm_fontrec definition, renamed to Dgg_fontrec to avoid clashes w/ real one*/
  144. /* The font structure is created using a handle.  The FntPtr is
  145. *  returned by a call to Nlm_HandLock (font).  Be sure to call
  146. *  Nlm_HandUnlock (font) after obtaining the font handle.
  147. */
  148.  
  149.  
  150. typedef  struct  Dgg_fontrec {
  151.   Nlm_FonT      next;
  152.   Nlm_Char      name [32];
  153.   Nlm_Int2      size;
  154.   Nlm_Int2      scale;
  155.   Nlm_Boolean   bld;
  156.   Nlm_Boolean   ital;
  157.   Nlm_Boolean   undlin;
  158.   Nlm_Int2      number;
  159.   Nlm_Int2      style;
  160.   Nlm_Handle    handle;
  161.   Nlm_FonT      print;
  162. } Dgg_FontRec, Dgg_FontData, PNTR Dgg_FntPtr;
  163.  
  164.  
  165.     /* some additional methods from vibrant needed by DCLAP */
  166. extern void Nlm_GetChoiceTitle  PROTO((Nlm_GraphiC c, Nlm_Int2 item,
  167.                                 Nlm_CharPtr title, Nlm_sizeT maxsize));
  168.  
  169. extern void Nlm_SetDialogTextFont PROTO((Nlm_FonT theFont));
  170.  
  171. extern void Nlm_SelectBackColor PROTO((Nlm_Uint1 red, Nlm_Uint1 green, Nlm_Uint1 blue));
  172. extern void Nlm_TextOpaque PROTO(());
  173. extern void Nlm_TextTransparent PROTO(());
  174. extern void Nlm_PenPattern PROTO((void *pat));
  175. extern Nlm_FonT  Nlm_fontInUse;
  176.  
  177. /* extern Nlm_Boolean Nlm_SetSlateBorder PROTO((Nlm_SlatE s, Boolean turnon)); */
  178.  
  179.     /* from vibincld.h */
  180. extern Nlm_GphPrcsPtr Nlm_GetClassPtr PROTO((Nlm_GraphiC a));
  181. extern void Nlm_SetRect PROTO((Nlm_GraphiC a, Nlm_RectPtr r));
  182.  
  183. extern Nlm_Handle Nlm_Parent PROTO((Nlm_Handle a));
  184. extern void Nlm_SetChild PROTO((Nlm_GraphiC a, Nlm_GraphiC chld));
  185. extern Nlm_GraphiC Nlm_GetChild PROTO((Nlm_GraphiC a));
  186. extern void Nlm_SetParent  PROTO((Nlm_GraphiC a, Nlm_GraphiC prnt));
  187.  
  188. #endif
  189.  
  190. /* multiline text -- Nlm_DrawText only handles one line */
  191. extern void Dgg_DrawTextbox  PROTO((Nlm_RectPtr r, Nlm_CharPtr text,
  192.                                ulong len, Nlm_Char jst, Nlm_Boolean gray));
  193.  
  194. extern void Dgg_PenNormal PROTO(()); /* nlmdraw addition */
  195.  
  196.     /* draw Mac PICT data */
  197. void Dgg_DrawPICTure (Nlm_RectPtr r, Nlm_VoidPtr pict);
  198. Nlm_VoidPtr Dgg_IsPICT( Nlm_VoidPtr pictdata, ulong datasize, Nlm_Boolean dontTestForHeader);
  199.  
  200. extern void Dgg_SetParentWindow PROTO((Nlm_GraphiC a, Nlm_WindoW newwindow));
  201.  
  202.     /* launch an app with a command line (mac,unix,vms,mswin) */
  203.     /* to launch document (mac) call w/ appName == docname and rest == NULL */
  204.     
  205. extern Nlm_Boolean Dgg_LaunchApp PROTO(( char* appName, char* commandline,
  206.                                                                                                                                     char* Stdin, char* Stdout, char* Stderr));
  207.  
  208.  
  209. /* dgg -- leave out vibdefns, which are just the Nlm_ less #defines
  210. #ifndef _VIBDEFNS_
  211. #include <vibdefns.h>
  212. #endif
  213. */
  214.  
  215.         /* vibrant's newer docpanel type */
  216. #ifndef _DOCUMENT_
  217. #include <document.h>
  218. #endif
  219.  
  220.     /* remove proc defs made in document.h */
  221. #undef DoC 
  222. #undef DocPrntProc 
  223. #undef DocClckProc 
  224. #undef DocDrawProc 
  225. #undef DocShadeProc 
  226. #undef DocDataProc 
  227. #undef DocPanProc 
  228. #undef DocFreeProc 
  229. #undef DocPutProc 
  230. #undef DocGetProc 
  231. #undef DocUpdProc 
  232. #undef ColPtr 
  233. #undef ColData 
  234. #undef ParData 
  235. #undef ParPtr 
  236. #undef DocumentPanel 
  237. #undef SetDocProcs 
  238. #undef SetDocShade 
  239. #undef SetDocCache 
  240. #undef SetDocData 
  241. #undef GetDocData 
  242. #undef GetDocText 
  243. #undef MapDocPoint 
  244. #undef PrintDocument 
  245. #undef SaveDocument 
  246. #undef GetDocParams 
  247. #undef GetItemParams 
  248. #undef GetColParams 
  249. #undef AppendItem 
  250. #undef AppendText 
  251. #undef ReplaceItem 
  252. #undef ReplaceText 
  253. #undef InsertItem 
  254. #undef InsertText 
  255. #undef DeleteItem 
  256. #undef ItemIsVisible 
  257. #undef GetScrlParams 
  258. #undef UpdateDocument 
  259. #undef AdjustDocScroll 
  260. #undef SetDocAutoAdjust 
  261. #undef DisplayFile 
  262. #undef DisplayFancy 
  263.  
  264. #undef SetDocTabstops  
  265.  
  266. #ifdef __cplusplus
  267. }
  268. #endif
  269.  
  270. #endif
  271.